
RedDotsInvasionRewardHandler ={};
local this = RedDotsInvasionRewardHandler;

function this.init()
    CloseEvent(Config.EventType.InvasionStageRewardChange,this.update);
    ListenEvent(Config.EventType.InvasionStageRewardChange,this.update);
    return this;
end

function this.getFlag(...)
    if not logicMgr.FuncOpenManager.isOpen(Config.FuncOpenType.InvasionBattle,false) then
        return Config.RedDotsFlagState.None
    end
    if not logicMgr.InvasionManager.IsOpen() then
        return Config.RedDotsFlagState.None
    end
    local state = Config.RedDotsFlagState.None
    local receiveId=InvasionHandler.receiveID
    local rewardData=logicMgr.InvasionManager.getInvasionRewards(receiveId,InvasionHandler.GetMyBossLv()-1)
    local reward={}
    if not table.isNullOrEmpty(reward)then
        state = Config.RedDotsFlagState.Needful
    end
    return state
end

function this.update()
    RedDotsManager.addBroadcast(Config.RedDotsType.InvasionReward);
end